import { Component } from '@angular/core';
import {LostOrFindService} from "../../services";
import {NzNotificationService} from "ng-zorro-antd/notification";

@Component({
  selector: 'app-find',
  templateUrl: './find.component.html',
  styleUrl: './find.component.css'
})
export class FindComponent {
  occasions: any[] | undefined;
  reload(){
    this.lostOrFindService.getSome(1, 100, false)
      .subscribe(
      {
        next: (occasions)=>{
          this.occasions = occasions;
          this.notification.success("加载成功","")
        },
        error: (error)=>{
          this.notification.error("加载失败","")
        }
      }
    )
  }
  constructor(private lostOrFindService: LostOrFindService,
              private notification: NzNotificationService) {
    this.reload();
  }
}
